/*
 * @Description: 
 * @Author: Yong
 * @Date: 2021-10-01 21:43:47
 * @LastEditTime: 2021-10-01 22:01:28
 */
import * as bcrypt from 'bcrypt'

const saltRounds = 10
const salt = bcrypt.genSaltSync(saltRounds)

export function bcryptHash (msg: string): string {
    return bcrypt.hashSync(msg, salt)
}

export function bcryptCompareSync (msg: string, hashMsg: string): boolean {
    return bcrypt.compareSync(msg, hashMsg)
}